<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue-2.4.0.js"></script>
    <link rel="stylesheet" href="./lib/animate.css">
    <!-- 入场动画使用 bounceIn， 离场动画使用 bounceOut -->

</head>
<body>
    <div id='app'>
        <input type="button" value="toggle" @click="flag=!flag">
        <!-- 方法一  animated 放在 transition 元素标签里-->
        <!-- <transition enter-active-class='animated bounceIn' leave-active-class='animated bounceOut'>
            <h3 v-if='flag'>大吉大利，今晚吃鸡~</h3>
        </transition> -->

        <!-- 方法二 animated 放在h3标签里, :duration='毫秒值' 指定入场和离场需要的时间-->
        <!-- <transition enter-active-class='bounceIn' leave-active-class='bounceOut' :duration='200'> 
            <h3 v-if='flag' class="animated">大吉大利，今晚吃鸡~</h3>
        </transition> -->

        <!-- 使用 :duration='{enter:200, leave:400} 来分别设置入场的时长和离场的时长 -->
        <transition enter-active-class='bounceIn' leave-active-class='bounceOut' :duration='{enter:200, leave:400}'> 
            <h3 v-if='flag' class="animated">大吉大利，今晚吃鸡~</h3>
        </transition>

    </div>
    
    <script>
        var vm = new Vue({
            el : '#app',
            data : {
                flag : false
            },
            methods:{

            }
        })
    </script>
</body>
</html>